package com.example.backend.mapper;
import com.example.backend.entity.Warehouse;
import com.example.backend.entity.Company;
import com.example.backend.entity.Port;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface WarehouseMapper {
    int insert(Warehouse warehouse);
    Warehouse selectById(Long id);
    List<Warehouse> selectAll();
    int update(Warehouse warehouse);
    int deleteById(@Param("id") Long id);
    List<Warehouse> selectByPortAndCompany(@Param("portId") Long portId, @Param("companyId") Long companyId);
    List<Warehouse> selectByPort(Long portId);
    List<Company> selectCompaniesByWarehouseId(Long warehouseId);
    int insertWarehouseCompany(@Param("warehouseId") Long warehouseId, @Param("companyId") Long companyId);
    int deleteWarehouseCompany(@Param("warehouseId") Long warehouseId, @Param("companyId") Long companyId);
    List<Warehouse> selectAvailableWarehousesByPort(Long portId);
} 